<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a new translation matrix</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.initscale.html">CairoMatrix::initScale</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.invert.html">CairoMatrix::invert</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairomatrix.inittranslate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoMatrix::initTranslate</h1>
  <h1 class="refname">cairo_matrix_init_translate</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoMatrix::initTranslate</span> -- <span class="refname">cairo_matrix_init_translate</span> &mdash; <span class="dc-title">Creates a new translation matrix</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cairomatrix.inittranslate-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格 (method):</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type"><span class="type void">void</span></span> <span class="methodname"><strong>CairoMatrix::initTranslate</strong></span>
    ( <span class="methodparam"><span class="type">float</span> <code class="parameter">$tx</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$ty</code></span>
   )</div>

  <p class="para rdfs-comment">过程化风格:</p>
  <div class="methodsynopsis dc-description">
   <span class="type">object</span> <span class="methodname"><strong>cairo_matrix_init_translate</strong></span>
    ( <span class="methodparam"><span class="type">float</span> <code class="parameter">$tx</code></span>
   , <span class="methodparam"><span class="type">float</span> <code class="parameter">$ty</code></span>
   )</div>

  <p class="para rdfs-comment">
   Creates a new matrix to a transformation that translates by tx and ty in the X
   and Y dimensions, respectively.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-cairomatrix.inittranslate-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">tx</code></em></dt>

     <dd>

      <p class="para">
       amount to translate in the X direction 
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">ty</code></em></dt>

     <dd>

      <p class="para">
       amount to translate in the Y direction 
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-cairomatrix.inittranslate-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a new CairoMatrix object that can be used with surfaces, contexts, and patterns.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cairomatrix.inittranslate-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3085">
    <p><strong>Example #1 面向对象风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;Matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">CairoMatrix</span><span style="color: #007700">::</span><span style="color: #0000BB">initTranslate</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3086">
    <p><strong>Example #2 过程化风格</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Create&nbsp;a&nbsp;new&nbsp;Matrix&nbsp;*/<br /></span><span style="color: #0000BB">$matrix&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cairo_matrix_init_translate</span><span style="color: #007700">(</span><span style="color: #0000BB">1.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2.0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-cairomatrix.inittranslate-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="cairomatrix.construct.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::__construct()</a> - Creates a new CairoMatrix object</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.initidentity.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initIdentity()</a> - Creates a new identity matrix</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.initrotate.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initRotate()</a> - Creates a new rotated matrix</span></li>
    <li class="member"><span class="methodname"><a href="cairomatrix.initscale.html" class="methodname" rel="rdfs-seeAlso">CairoMatrix::initScale()</a> - Creates a new scaling matrix</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairomatrix.initscale.html">CairoMatrix::initScale</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairomatrix.invert.html">CairoMatrix::invert</a></div>
 <div class="up"><a href="class.cairomatrix.html">CairoMatrix</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
